import React from 'react';
import { Tag } from 'antd';
import * as commonDictOptions from "@/constants"
import { getLabel } from "@/utils";

const PROJECT_STATUS_MAP_COLOR = {
    1: "magenta",
    2: "cyan",
    3: "red",
    4: "green",
    5: "purple",
    6: "geekblue",
    7: "lime",
}
export const columns = [
    {
        title: '项目名称',
        dataIndex: 'projectName',
        ellipsis: true,
        key: 'projectName',
    },
    {
        title: '监督员',
        ellipsis: true,
        dataIndex: 'supervisor_name',
        key: 'supervisor_name',
    },
    {
        title: '监督注册号',
        ellipsis: true,
        dataIndex: 'supervisor_register_no',
        key: 'supervisor_register_no',
    },
    {
        title: '分管站长',
        key: 'branch_manager',
        ellipsis: true,
        dataIndex: 'branch_manager',
    },
    {
        title: '所属街道',
        ellipsis: true,
        dataIndex: "streetName",
        key: 'streetName',
    },
    {
        title: '所属平台',
        ellipsis: true,
        key: 'platform',
        render: (_, { platform }) => getLabel(commonDictOptions.platformOptions, platform),
    },
    {
        title: '所属部门',
        ellipsis: true,
        key: 'department',
        render: (_, { department }) => getLabel(commonDictOptions.departmentOptions, department)
    },
    {
        title: '项目状态',
        ellipsis: true,
        key: 'projectStatus',
        render: (_, { projectStatus }) => <Tag color={PROJECT_STATUS_MAP_COLOR[projectStatus]}>{getLabel(commonDictOptions.projectStatusOptions, projectStatus)}</Tag>

    },
];

